Skip to content

Reject mismatched file section markers#340

Merged
codeforester merged 1 commit into
masterfrom
bug/330-20260531-file-section-marker-mismatch
May 31, 2026
Merged

Reject mismatched file section markers#340
codeforester merged 1 commit into
masterfrom
bug/330-20260531-file-section-marker-mismatch

Conversation

@codeforester
Copy link
Copy Markdown
Owner

Summary

  • Count start and end markers before update_file_section modifies a file.
  • Return a clear error when a file contains only one side of the managed marker pair.
  • Add BATS coverage for start-only and end-only corrupted sections.

Validation

  • bats lib/bash/file/tests/lib_file.bats
  • env -u BASE_HOME HOME=/private/tmp/base-review-home BASE_TEST_PYTHON=/Users/rameshhp/.base.d/base/.venv/bin/python bin/base-test
  • git diff --check

Closes #330

@codeforester codeforester merged commit b03b951 into master May 31, 2026
16 checks passed
@codeforester codeforester deleted the bug/330-20260531-file-section-marker-mismatch branch May 31, 2026 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

update_file_section in lib_file.sh has undefined behaviour when start marker exists but end marker is absent

1 participant